<table width="100%" align="center" cellpadding="0" cellspacing="0" id="judul">
  <tr align="center">
    <td width="100%" colspan="12"><h3>Rekapitulasi Helpdesk Dinas Sistem Informasi</h3></td>
  </tr>
  <tr align="center">
    <td width="100%" colspan="12"><h3>Terminal Petikemas Semarang</h3></td>
  </tr>
  <tr align="center">
    <td width="100%" colspan="12"><h3>PT. Pelabuhan Indonesia III (Persero)</h3></td>
  </tr>
  <tr align="center">
    <td colspan="12"><h4>Tahun <?= $tahun; ?></h4></td>
  </tr>
</table>
<p>&nbsp;</p>
<table border="2">
  <tr align="center">
    <th width="auto" rowspan="2">No</th>
    <th width="auto" rowspan="2">Kode Helpdesk</th>
    <th width="auto" rowspan="2">Jenis</th>
    <th width="auto" rowspan="2">Sub Jenis</th>
    <th width="auto" rowspan="2">Isi</th>
    <th width="auto" rowspan="2">Tanggal Entry</th>
    <th width="auto" rowspan="2">User Entry<br>Divisi</th>
    <th width="auto" rowspan="2">Uraian</th>
    <th width="auto" rowspan="2">User Kerja</th>
    <th width="auto" rowspan="2">Keterangan</th>
    <th width="auto" rowspan="2">Tanggal Selesai</th>
    <th width="auto" rowspan="2">Keterangan Selesai</th>
    </tr>
  <tr>
    </tr>
  <?php $no = 1;
 	foreach($helpdesk -> result() as $row){      
 	?>
  <tr align="center">
    <td><?php echo $no; ?></td>
    <td><?php echo $row->KODE; ?></td>
    <td><?= $row->JENIS; ?></td>
    <td><?= $row->SUB_JENIS; ?></td>
    <td><?= $row->ISI; ?></td>
    <td><?= $row->TGL_ENTRY; ?></td>
    <td><?php
      if (isset($row->USER_ENTRY) && $row->USER_ENTRY != '0') {
        foreach ($this->helpdesk_model->get_nama_entry($row->USER_ENTRY) as $key1) {
        $user_entry = $key1->NAMA_PEKERJA;
        }
      } else {
        $user_entry = '';
      }
      echo $user_entry; ?><br>
      <?php 
      if (isset($row->USER_ENTRY) && $row->USER_ENTRY != '0') {
        foreach ($this->helpdesk_model->get_divisi_user($row->USER_ENTRY) as $divkey1) {
        $divisi = $divkey1->NAMA_UNIT_KERJA;
        }
      } else {
        $divisi = '';
      }
      echo $divisi;
      ?>
    </td>
    <td><?= $row->URAIAN; ?></td>
    <td><?php 
      if (isset($row->USER_KERJA) && $row->USER_KERJA != '0') {
        foreach ($this->helpdesk_model->get_nama_kerja($row->USER_KERJA) as $key2) {
        $user_kerja = $key2->NAMA;
        }
      } else {
        $user_kerja = '';
      }
      echo $user_kerja; ?></td>
    <td><?= $row->KETERANGAN; ?></td>
    <td><?= $row->TGL_SELESAI; ?></td>
    <td><?= $row->KET_SELESAI; ?></td>
    </tr>
  <?php $no++;}?>
  <tr>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
    </tr>
  </table>
<p>&nbsp;</p>
